#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
@file_name: creating_a_multithreaded_python_app.py
@date: 2025-07-21 13:48
@author: Falling Snow
@desc: 创建多线程 Python 应用程序
"""

import threading


def hello_from_thread():
    print(f"你好, 运行该方法的线程为: {threading.current_thread()}!")


hello_thread = threading.Thread(target=hello_from_thread)
hello_thread.start()

total_thread = threading.active_count()
thread_name = threading.current_thread().name

print(f"Python当前运行的线程数量为: {total_thread}")
print(f"当前的线程名称为: {thread_name}")

hello_thread.join()
